# Maintainer: Keith Toh <ktprograms@gmail.com>
pkgname=py3-shtab
pkgver=1.5.4
pkgrel=0
pkgdesc="Automagic shell tab completion for Python CLI applications"
url="https://docs.iterative.ai/shtab/"
arch="noarch"
license="Apache-2.0"
depends="python3"
makedepends="py3-setuptools py3-setuptools_scm py3-wheel"
checkdepends="py3-pytest py3-pytest-cov py3-pytest-timeout bash"
subpackages="$pkgname-doc"
source="https://github.com/iterative/shtab/releases/download/v$pkgver/shtab-$pkgver.tar.gz"
builddir="$srcdir/shtab-$pkgver"

build() {
	python3 setup.py build
}

check() {
	pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

doc() {
	pkgdesc="$pkgdesc (documentation)"

	install -Dm644 "$builddir"/LICENCE "$subpkgdir"/usr/share/licenses/$pkgname/LICENSE
	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/examples
	cp "$builddir"/examples/* "$subpkgdir"/usr/share/doc/$pkgname/examples/
}

sha512sums="
6c9877971fdcb5d7adb684aa873503a51b51db7a84368a58f36d5c86cef31260267d5219173cf250542773188aac46b31000c402d61a6cd33c25fd82b21b7b35  shtab-1.5.4.tar.gz
"
